
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <title>MyBatis3 代码生成</title>
    <!-- Bootstrap core CSS -->
    <link href="http://cdn.bootcss.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet">
    <link href="css/main.css" rel="stylesheet">
    <!--[if lt IE 9]>
    <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>

<nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">MyBatis3 代码生成</a>
        </div>
        <div id="navbar" class="collapse navbar-collapse">
            <ul class="nav navbar-nav">
                <li class="active"><a href="#">主页</a></li>
                <li><a href="http://keeleys.github.io/mybatis_online/" target="_blank">例子</a></li>
            </ul>
        </div><!--/.nav-collapse -->
    </div>
</nav>

<div class="container-fluid">
    <form   id="configForm" method="post" class="form-horizontal">
        <div class="row">

            <div class="col-sm-6">
                <div class="panel panel-default">
                    <div class="panel-heading">项目设置</div>
                    <div class="panel-body">
                        <div class="form-group">
                            <label for="driverClass" class="col-sm-2 control-label">root目录</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="configBean.projectUrl" readonly id="projectUrl" placeholder="E:\\tianjun\\temp" value="${root_dir}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="connectionURL" class="col-sm-2 control-label">model路径</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" id="modelUrl" name="configBean.modelUrl" placeholder="com.keeley.model" value="com.keeley.model">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="username" class="col-sm-2 control-label">sqlxml路径</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="configBean.mappingUrl" id="mappingUrl" placeholder="com.keeley.mapping" value="com.keeley.mapping">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="password" class="col-sm-2 control-label">mapper路径</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" id="mapperUrl" name="configBean.mapperUrl" placeholder="com.keeley.mapper" value="com.keeley.mapper">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="password" class="col-sm-1 control-label">表</label>
                            <div class="col-sm-3">
                                <input type="text" class="form-control" name="configBean.schemaName"  placeholder="schema" value="e3data">
                            </div>
                            <div class="col-sm-4">
                                <input type="text" class="form-control"  name="configBean.tableName" placeholder="tableName" value="e3_log">
                            </div>
                            <div class="col-sm-4">
                                <input type="text" class="form-control"  name="configBean.beanName" placeholder="beanName" value="E3Log">
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="col-sm-6">
                <div class="panel panel-default">
                    <div class="panel-heading">基本设置</div>
                    <div class="panel-body">
                        <div class="form-group">
                            <label for="driverClass" class="col-sm-2 control-label">数据驱动</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="configBean.driverClass" id="driverClass" value="oracle.jdbc.driver.OracleDriver" placeholder="oracle.jdbc.driver.OracleDriver">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="connectionURL" class="col-sm-2 control-label">链接地址</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="configBean.connectionURL" id="connectionURL" placeholder="jdbc地址" value="">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="username" class="col-sm-2 control-label">用户名</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" name="configBean.username" id="username" value="e3data" placeholder="e3data">
                            </div>
                            <label for="password" class="col-sm-2 control-label">密码</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" name="configBean.password" id="password" placeholder="请输入密码" value="">
                            </div>
                        </div>
                        <div>
                            <label for="username" class="col-sm-2 control-label">生成模式</label>
                            <div class="col-sm-10">
                                 <input type="radio" name="configBean.build_type" value="0" checked/> 普通mapper
                                 <input type="radio" name="configBean.build_type" value="1"/> 通用mapper
                                <div class="alert alert-info" role="alert">
                                    通用mapper 需要配置插件 <code><a href="https://github.com/abel533/Mapper" target="_blank">https://github.com/abel533/Mapper</a></code>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-10">
                                <button type="reset" class="btn btn-default">还原默认</button>
                                <button type="submit" class="btn btn-default">生成代码</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </form>
    <div class="row tab_data" style="display: none">
        <div class="col-sm-12">
            <div role="tabpanel">
                <!-- Nav tabs -->
                <ul class="nav nav-tabs" role="tablist">
                    <li role="presentation" class="active">
                        <a href="#tab_model" aria-controls="home" role="tab" data-toggle="tab">Model</a>
                    </li>
                    <li role="presentation"><a href="#tab_xml" aria-controls="profile" role="tab" data-toggle="tab">Xml</a></li>
                    <li role="presentation"><a href="#tab_mapper" aria-controls="messages" role="tab" data-toggle="tab">Mapper</a></li>
                    <li role="presentation"><a href="#tab_example" aria-controls="messages" role="tab" data-toggle="tab">example</a></li>
                </ul>
                <div class="tab-content">
                    <div role="tabpanel" class="tab-pane active" id="tab_model" >
                        <div class="btn-group" role="group" aria-label="...">
                            <a role="button" class="btn btn-default btn_copy" href="javascript:void(0)" data-toggle="tooltip" data-placement="top" title="点击复制">复制</a>
                            <a role="button" class="btn btn-default btn_down" href="#">下载</a>
                        </div>
                        <pre></pre>
                    </div>
                    <div role="tabpanel" class="tab-pane" id="tab_xml">
                        <div class="btn-group" role="group" aria-label="...">
                            <a role="button" class="btn btn-default btn_copy" href="javascript:void(0)" data-toggle="tooltip"  title="点击复制">复制</a>
                            <a role="button" class="btn btn-default btn_down" href="#">下载</a>
                        </div>
                        <pre></pre></div>
                    <div role="tabpanel" class="tab-pane" id="tab_mapper">
                        <div class="btn-group" role="group" aria-label="...">
                            <a role="button" class="btn btn-default btn_copy" href="javascript:void(0)" data-toggle="tooltip" title="点击复制">复制</a>
                            <a role="button" class="btn btn-default btn_down" href="#">下载</a>
                        </div>
                        <pre></pre></div>
                    <div role="tabpanel" class="tab-pane" id="tab_example">
                        <div class="btn-group" role="group" aria-label="...">
                            <a role="button" class="btn btn-default btn_copy"href="javascript:void(0)" data-toggle="tooltip"  title="点击复制">复制</a>
                            <a role="button" class="btn btn-default btn_down" href="#">下载</a>
                        </div>
                        <pre></pre></div>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="load_div" style="display: none">
<img src="image/load.gif"/>
</div>

<script src="http://cdn.bootcss.com/jquery/1.11.2/jquery.min.js"></script>
<script src="http://cdn.bootcss.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
<script src="js/zeroclipboard/ZeroClipboard.min.js"></script>
<script src="js/data_config.js"></script>
<script src="js/jquery.formLocalStorage.js"></script>
<script type="text/javascript">
    $("#configForm").formLocalStorage({
        debug:true,
        storage_remove_on_submit:false
    });

    var client = new ZeroClipboard( $('.btn_copy') );
    client.on( 'ready', function(event) {
        client.on( 'copy', function(event) {
           var str =  $(event.target).parent().next("pre").prop("innerText");
            event.clipboardData.setData('text/plain',str);
        } );
        client.on( 'aftercopy', function(event) {
            $(event.target).attr("title","已经复制");
            $(event.target).attr("data-original-title","已经复制");
            $(event.target).tooltip('show')
        } );
    } );
    $('[data-toggle="tooltip"]').tooltip();
</script>
</body>
</html>
